package com.swh.user.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Page;
import org.springframework.data.repository.NoRepositoryBean;

import com.swh.user.entity.TbUser;



import java.util.List;
import java.util.Map;


/**
* @Description 用户 数据访问接口
* @date 2021-01-15 17:27:10
*/

@NoRepositoryBean
public interface BaseDao<T> extends JpaRepository<T,String>, JpaSpecificationExecutor<T> {


        /**
        * sql查询
        *
        * @param sql
        * @param args
        * @return
        */
        List<Map> findAllByParams(String sql, Object... args);

            /**
            * sql分页查询
            *
            * @param sql
            * @param args
            * @return
            */
            Page<Map> findPageByParams(String sql, Pageable pageable, Object... args);
}